package cc.chengheng.controller;

import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

    @GetMapping("/hello")
    @ResponseBody
    public String hello() {
        return "nihao";
    }


    @Secured({"ROLE_sale", "ROLE_manager"})
    @GetMapping("/fengliulin")
    @ResponseBody
    public String fengliulin() {
        return "fengliulin";
    }

    @PostMapping("/login")
    @ResponseBody
    public String login() {
        return "fengliulin";
    }
}
